#include "formviewer.h"
#include "ui_formviewer.h"
#include "xmlhighlighter.h"

FormViewer::FormViewer(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::FormViewer),
    Highlighter( new XmlHighlighter(this))
{
    ui->setupUi(this);
    Highlighter->setDocument(ui->textEdit->document());
}

FormViewer::~FormViewer()
{
    delete ui;
    delete Highlighter;
}

void FormViewer::setText(const QString &text)
{
    ui->textEdit->setText(text);
}

QString FormViewer::text()
{
    return ui->textEdit->toPlainText();
}
